package com.jluzh.server;

import com.jluzh.bean.Employee;

import javax.servlet.ServletContext;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;

/**
 * @author EvanHuang
 * @date 11/5/2018 10:20 AM
 * @since
 */
@Path("parent")
public class ParentResource {
    @GET
    @Produces(MediaType.APPLICATION_JSON)
    public Employee get(@Context ServletContext ctx) {
        System.out.println(ctx);
        return new Employee(1L, "哈哈", 2);
    }

    // 会去执行ChildResource的资源
    @Path("child")
    public ChildResource childResource(){
        return new ChildResource();
    }

}
